package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class HeaderItemName {

    private int beginIndex;
    private int endIndex;
    private HeaderItemNameType headerItemNameType;

    public HeaderItemName(int beginIndex, int endIndex, HeaderItemNameType headerItemNameType) {
        this.beginIndex = beginIndex;
        this.endIndex = endIndex;
        this.headerItemNameType = headerItemNameType;
    }

    public int getBeginIndex() {
        return beginIndex;
    }

    public int getEndIndex() {
        return endIndex;
    }

    public boolean isCount() {
        return headerItemNameType == HeaderItemNameType.COUNT;
    }

    public boolean isKeyType() {
        return headerItemNameType == HeaderItemNameType.KEY_TYPE;
    }

    public boolean isDynamicFunction() {
        return headerItemNameType == HeaderItemNameType.DYNAMIC_FUNCTION;
    }

    public boolean isDynamicFunctionCode() {
        return headerItemNameType == HeaderItemNameType.DYNAMIC_FUNCTION_CODE;
    }

    public boolean isTopLevelCount() {
        return headerItemNameType == HeaderItemNameType.TOP_LEVEL_COUNT;
    }

}
